package com.pd.Singleton;

/**
 * Created with IntelliJ IDEA.
 * User: 5
 * Date: 16-12-14
 * Time: 下午4:45
 * 饿汉式 简单暴力 线程安全    --final static
 */
public class StarvSinglegon {
    private final static StarvSinglegon singlegon = new StarvSinglegon();

    public static StarvSinglegon getSinglegon() {
        return singlegon;
    }
    public static void main(String args[]) {
        for (int i = 0; i < 15; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    System.out.println(StarvSinglegon.getSinglegon());
                }
            }).start();
        }
    }
}
